#include <stdio.h>
#include "blk1010_ffi.h"

int main()
{
    unsigned char data[64];
    unsigned char out[3];
    rs_BlockFillMaster *f = rs_Blk1010FillMaster_new(10);
    rs_Map *a = rs_Blk1010Map_new(8, 8);
    rs_Blk1010Map_assign(a, data, 64, 0, 0, 0);
    rs_Blk1010Map_assign_by_mapid(a, 2, 0, 0);
    rs_Blk1010FillMaster_fill_request(f, a);
    while(1) {
        unsigned r = rs_Blk1010FillMaster_update(f, out);
        printf("ret...%d\n", r);
        if(r>0) break;
    }
    for(int i=0; i<3; i++) {
        printf("blk[%d] = %d\n", i, out[i]);
    }
    rs_Blk1010Map_free(a);
    rs_Blk1010FillMaster_free(f);
    return 0;
}

